package com.example.esp8266.Library.RoomLib;

import androidx.room.Entity;
import androidx.room.PrimaryKey;
import androidx.room.ForeignKey;

import java.io.Serializable;

@Entity(tableName = "task",
        foreignKeys = @ForeignKey(entity = TaskGroup.class,
                parentColumns = "id",
                childColumns = "taskGroupId",
                onDelete = ForeignKey.CASCADE))
public class Task implements Serializable {
    @PrimaryKey(autoGenerate = true)
    public int id;

    public int taskGroupId;

    public String taskName;  // 任务名称

    // 默认构造函数
    public Task() {}

    // 便于创建对象的构造函数
    public Task(int taskGroupId, String taskName) {
        this.taskGroupId = taskGroupId;
        this.taskName = taskName;
    }

    // Getters 和 Setters
}